import {createApi} from "@/soar/utils/request";
import {nextId, randomElement, randomNumber, randomString} from "@/soar/utils/random";
import createMock from "@/soar/utils/mock";

export const basePath = '/demo';

const api = createApi<any>(basePath, 'demo');

export const sex = {
    0: '未知',
    1: '男',
    2: '女',
}

export default {
    ...api,
    ...createMock((i) => {
        return {
            id: nextId(),
            name: randomString(5),
            age: randomNumber(18, 60),
            sex: randomElement(Object.keys(sex)),
        }
    }),
}